﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AlumniProject.Framework;

namespace AlumniProject
{
    public partial class TrangChu : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["name"] != null)
            {
                lblLoiChao.Text = "Chào bạn " + Session["name"].ToString();
                pnlLoiChao.Visible = true;
                pnlDangNhapDK.Visible = false;
            }
            else
            {
                pnlLoiChao.Visible = false;
                pnlDangNhapDK.Visible = true;
            }

            BaiVietAccess bai = new BaiVietAccess();
            PagedDataSource pg = new PagedDataSource();
            pg.DataSource = bai.LoadTinMoiNhat().DefaultView;
            pg.AllowPaging = true;
            pg.PageSize = 10;
            lst.DataSource = pg;
            lst.DataBind();
        }

        protected void lst_ItemCommand(object source, DataListCommandEventArgs e)
        {
            string MaBaiViet = e.CommandArgument.ToString(); 
        }
    }
}